/*

Don't alter this file, it was generated.

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

package fake

import (
	"context"

	v1alpha1 "code.cloudfoundry.org/quarks-operator/pkg/kube/apis/boshdeployment/v1alpha1"
	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	labels "k8s.io/apimachinery/pkg/labels"
	schema "k8s.io/apimachinery/pkg/runtime/schema"
	types "k8s.io/apimachinery/pkg/types"
	watch "k8s.io/apimachinery/pkg/watch"
	testing "k8s.io/client-go/testing"
)

// FakeBOSHDeployments implements BOSHDeploymentInterface
type FakeBOSHDeployments struct {
	Fake *FakeBoshdeploymentV1alpha1
	ns   string
}

var boshdeploymentsResource = schema.GroupVersionResource{Group: "boshdeployment", Version: "v1alpha1", Resource: "boshdeployments"}

var boshdeploymentsKind = schema.GroupVersionKind{Group: "boshdeployment", Version: "v1alpha1", Kind: "BOSHDeployment"}

// Get takes name of the bOSHDeployment, and returns the corresponding bOSHDeployment object, and an error if there is any.
func (c *FakeBOSHDeployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BOSHDeployment, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewGetAction(boshdeploymentsResource, c.ns, name), &v1alpha1.BOSHDeployment{})

	if obj == nil {
		return nil, err
	}
	return obj.(*v1alpha1.BOSHDeployment), err
}

// List takes label and field selectors, and returns the list of BOSHDeployments that match those selectors.
func (c *FakeBOSHDeployments) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BOSHDeploymentList, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewListAction(boshdeploymentsResource, boshdeploymentsKind, c.ns, opts), &v1alpha1.BOSHDeploymentList{})

	if obj == nil {
		return nil, err
	}

	label, _, _ := testing.ExtractFromListOptions(opts)
	if label == nil {
		label = labels.Everything()
	}
	list := &v1alpha1.BOSHDeploymentList{ListMeta: obj.(*v1alpha1.BOSHDeploymentList).ListMeta}
	for _, item := range obj.(*v1alpha1.BOSHDeploymentList).Items {
		if label.Matches(labels.Set(item.Labels)) {
			list.Items = append(list.Items, item)
		}
	}
	return list, err
}

// Watch returns a watch.Interface that watches the requested bOSHDeployments.
func (c *FakeBOSHDeployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
	return c.Fake.
		InvokesWatch(testing.NewWatchAction(boshdeploymentsResource, c.ns, opts))

}

// Create takes the representation of a bOSHDeployment and creates it.  Returns the server's representation of the bOSHDeployment, and an error, if there is any.
func (c *FakeBOSHDeployments) Create(ctx context.Context, bOSHDeployment *v1alpha1.BOSHDeployment, opts v1.CreateOptions) (result *v1alpha1.BOSHDeployment, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewCreateAction(boshdeploymentsResource, c.ns, bOSHDeployment), &v1alpha1.BOSHDeployment{})

	if obj == nil {
		return nil, err
	}
	return obj.(*v1alpha1.BOSHDeployment), err
}

// Update takes the representation of a bOSHDeployment and updates it. Returns the server's representation of the bOSHDeployment, and an error, if there is any.
func (c *FakeBOSHDeployments) Update(ctx context.Context, bOSHDeployment *v1alpha1.BOSHDeployment, opts v1.UpdateOptions) (result *v1alpha1.BOSHDeployment, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewUpdateAction(boshdeploymentsResource, c.ns, bOSHDeployment), &v1alpha1.BOSHDeployment{})

	if obj == nil {
		return nil, err
	}
	return obj.(*v1alpha1.BOSHDeployment), err
}

// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeBOSHDeployments) UpdateStatus(ctx context.Context, bOSHDeployment *v1alpha1.BOSHDeployment, opts v1.UpdateOptions) (*v1alpha1.BOSHDeployment, error) {
	obj, err := c.Fake.
		Invokes(testing.NewUpdateSubresourceAction(boshdeploymentsResource, "status", c.ns, bOSHDeployment), &v1alpha1.BOSHDeployment{})

	if obj == nil {
		return nil, err
	}
	return obj.(*v1alpha1.BOSHDeployment), err
}

// Delete takes name of the bOSHDeployment and deletes it. Returns an error if one occurs.
func (c *FakeBOSHDeployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
	_, err := c.Fake.
		Invokes(testing.NewDeleteAction(boshdeploymentsResource, c.ns, name), &v1alpha1.BOSHDeployment{})

	return err
}

// DeleteCollection deletes a collection of objects.
func (c *FakeBOSHDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
	action := testing.NewDeleteCollectionAction(boshdeploymentsResource, c.ns, listOpts)

	_, err := c.Fake.Invokes(action, &v1alpha1.BOSHDeploymentList{})
	return err
}

// Patch applies the patch and returns the patched bOSHDeployment.
func (c *FakeBOSHDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BOSHDeployment, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewPatchSubresourceAction(boshdeploymentsResource, c.ns, name, pt, data, subresources...), &v1alpha1.BOSHDeployment{})

	if obj == nil {
		return nil, err
	}
	return obj.(*v1alpha1.BOSHDeployment), err
}
