6b3066c4490b294b9630544169990c1fb094ac51
[multicloud/k8s.git] /
1 /*
2  * Copyright 2019 Intel Corporation, Inc
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 // Code generated by client-gen. DO NOT EDIT.
17
18 package fake
19
20 import (
21         v1alpha1 "monitor/pkg/apis/k8splugin/v1alpha1"
22
23         v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
24         labels "k8s.io/apimachinery/pkg/labels"
25         schema "k8s.io/apimachinery/pkg/runtime/schema"
26         types "k8s.io/apimachinery/pkg/types"
27         watch "k8s.io/apimachinery/pkg/watch"
28         testing "k8s.io/client-go/testing"
29 )
30
31 // FakeResourceBundleStates implements ResourceBundleStateInterface
32 type FakeResourceBundleStates struct {
33         Fake *FakeK8spluginV1alpha1
34         ns   string
35 }
36
37 var resourcebundlestatesResource = schema.GroupVersionResource{Group: "k8splugin.io", Version: "v1alpha1", Resource: "resourcebundlestates"}
38
39 var resourcebundlestatesKind = schema.GroupVersionKind{Group: "k8splugin.io", Version: "v1alpha1", Kind: "ResourceBundleState"}
40
41 // Get takes name of the resourceBundleState, and returns the corresponding resourceBundleState object, and an error if there is any.
42 func (c *FakeResourceBundleStates) Get(name string, options v1.GetOptions) (result *v1alpha1.ResourceBundleState, err error) {
43         obj, err := c.Fake.
44                 Invokes(testing.NewGetAction(resourcebundlestatesResource, c.ns, name), &v1alpha1.ResourceBundleState{})
45
46         if obj == nil {
47                 return nil, err
48         }
49         return obj.(*v1alpha1.ResourceBundleState), err
50 }
51
52 // List takes label and field selectors, and returns the list of ResourceBundleStates that match those selectors.
53 func (c *FakeResourceBundleStates) List(opts v1.ListOptions) (result *v1alpha1.ResourceBundleStateList, err error) {
54         obj, err := c.Fake.
55                 Invokes(testing.NewListAction(resourcebundlestatesResource, resourcebundlestatesKind, c.ns, opts), &v1alpha1.ResourceBundleStateList{})
56
57         if obj == nil {
58                 return nil, err
59         }
60
61         label, _, _ := testing.ExtractFromListOptions(opts)
62         if label == nil {
63                 label = labels.Everything()
64         }
65         list := &v1alpha1.ResourceBundleStateList{ListMeta: obj.(*v1alpha1.ResourceBundleStateList).ListMeta}
66         for _, item := range obj.(*v1alpha1.ResourceBundleStateList).Items {
67                 if label.Matches(labels.Set(item.Labels)) {
68                         list.Items = append(list.Items, item)
69                 }
70         }
71         return list, err
72 }
73
74 // Watch returns a watch.Interface that watches the requested resourceBundleStates.
75 func (c *FakeResourceBundleStates) Watch(opts v1.ListOptions) (watch.Interface, error) {
76         return c.Fake.
77                 InvokesWatch(testing.NewWatchAction(resourcebundlestatesResource, c.ns, opts))
78
79 }
80
81 // Create takes the representation of a resourceBundleState and creates it.  Returns the server's representation of the resourceBundleState, and an error, if there is any.
82 func (c *FakeResourceBundleStates) Create(resourceBundleState *v1alpha1.ResourceBundleState) (result *v1alpha1.ResourceBundleState, err error) {
83         obj, err := c.Fake.
84                 Invokes(testing.NewCreateAction(resourcebundlestatesResource, c.ns, resourceBundleState), &v1alpha1.ResourceBundleState{})
85
86         if obj == nil {
87                 return nil, err
88         }
89         return obj.(*v1alpha1.ResourceBundleState), err
90 }
91
92 // Update takes the representation of a resourceBundleState and updates it. Returns the server's representation of the resourceBundleState, and an error, if there is any.
93 func (c *FakeResourceBundleStates) Update(resourceBundleState *v1alpha1.ResourceBundleState) (result *v1alpha1.ResourceBundleState, err error) {
94         obj, err := c.Fake.
95                 Invokes(testing.NewUpdateAction(resourcebundlestatesResource, c.ns, resourceBundleState), &v1alpha1.ResourceBundleState{})
96
97         if obj == nil {
98                 return nil, err
99         }
100         return obj.(*v1alpha1.ResourceBundleState), err
101 }
102
103 // UpdateStatus was generated because the type contains a Status member.
104 // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
105 func (c *FakeResourceBundleStates) UpdateStatus(resourceBundleState *v1alpha1.ResourceBundleState) (*v1alpha1.ResourceBundleState, error) {
106         obj, err := c.Fake.
107                 Invokes(testing.NewUpdateSubresourceAction(resourcebundlestatesResource, "status", c.ns, resourceBundleState), &v1alpha1.ResourceBundleState{})
108
109         if obj == nil {
110                 return nil, err
111         }
112         return obj.(*v1alpha1.ResourceBundleState), err
113 }
114
115 // Delete takes name of the resourceBundleState and deletes it. Returns an error if one occurs.
116 func (c *FakeResourceBundleStates) Delete(name string, options *v1.DeleteOptions) error {
117         _, err := c.Fake.
118                 Invokes(testing.NewDeleteAction(resourcebundlestatesResource, c.ns, name), &v1alpha1.ResourceBundleState{})
119
120         return err
121 }
122
123 // DeleteCollection deletes a collection of objects.
124 func (c *FakeResourceBundleStates) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
125         action := testing.NewDeleteCollectionAction(resourcebundlestatesResource, c.ns, listOptions)
126
127         _, err := c.Fake.Invokes(action, &v1alpha1.ResourceBundleStateList{})
128         return err
129 }
130
131 // Patch applies the patch and returns the patched resourceBundleState.
132 func (c *FakeResourceBundleStates) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ResourceBundleState, err error) {
133         obj, err := c.Fake.
134                 Invokes(testing.NewPatchSubresourceAction(resourcebundlestatesResource, c.ns, name, pt, data, subresources...), &v1alpha1.ResourceBundleState{})
135
136         if obj == nil {
137                 return nil, err
138         }
139         return obj.(*v1alpha1.ResourceBundleState), err
140 }