/*
Copyright The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Code generated by client-gen. DO NOT EDIT.

package fake

import (
	context "context"

	v1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	corev1 "k8s.io/client-go/applyconfigurations/core/v1"
	gentype "k8s.io/client-go/gentype"
	typedcorev1 "k8s.io/client-go/kubernetes/typed/core/v1"
	testing "k8s.io/client-go/testing"
)

// fakePods implements PodInterface
type fakePods struct {
	*gentype.FakeClientWithListAndApply[*v1.Pod, *v1.PodList, *corev1.PodApplyConfiguration]
	Fake *FakeCoreV1
}

func newFakePods(fake *FakeCoreV1, namespace string) typedcorev1.PodInterface {
	return &fakePods{
		gentype.NewFakeClientWithListAndApply[*v1.Pod, *v1.PodList, *corev1.PodApplyConfiguration](
			fake.Fake,
			namespace,
			v1.SchemeGroupVersion.WithResource("pods"),
			v1.SchemeGroupVersion.WithKind("Pod"),
			func() *v1.Pod { return &v1.Pod{} },
			func() *v1.PodList { return &v1.PodList{} },
			func(dst, src *v1.PodList) { dst.ListMeta = src.ListMeta },
			func(list *v1.PodList) []*v1.Pod { return gentype.ToPointerSlice(list.Items) },
			func(list *v1.PodList, items []*v1.Pod) { list.Items = gentype.FromPointerSlice(items) },
		),
		fake,
	}
}

// UpdateEphemeralContainers takes the representation of a pod and updates it. Returns the server's representation of the pod, and an error, if there is any.
func (c *fakePods) UpdateEphemeralContainers(ctx context.Context, podName string, pod *v1.Pod, opts metav1.UpdateOptions) (result *v1.Pod, err error) {
	emptyResult := &v1.Pod{}
	obj, err := c.Fake.
		Invokes(testing.NewUpdateSubresourceActionWithOptions(c.Resource(), "ephemeralcontainers", c.Namespace(), pod, opts), &v1.Pod{})

	if obj == nil {
		return emptyResult, err
	}
	return obj.(*v1.Pod), err
}

// UpdateResize takes the representation of a pod and updates it. Returns the server's representation of the pod, and an error, if there is any.
func (c *fakePods) UpdateResize(ctx context.Context, podName string, pod *v1.Pod, opts metav1.UpdateOptions) (result *v1.Pod, err error) {
	emptyResult := &v1.Pod{}
	obj, err := c.Fake.
		Invokes(testing.NewUpdateSubresourceActionWithOptions(c.Resource(), "resize", c.Namespace(), pod, opts), &v1.Pod{})

	if obj == nil {
		return emptyResult, err
	}
	return obj.(*v1.Pod), err
}
