Remove BPA from Makefile
[icn.git] / cmd / bpa-operator / vendor / k8s.io / client-go / kubernetes / typed / apps / v1 / fake / fake_replicaset.go
1 /*
2 Copyright The Kubernetes Authors.
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
17 // Code generated by client-gen. DO NOT EDIT.
18
19 package fake
20
21 import (
22         appsv1 "k8s.io/api/apps/v1"
23         autoscalingv1 "k8s.io/api/autoscaling/v1"
24         v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
25         labels "k8s.io/apimachinery/pkg/labels"
26         schema "k8s.io/apimachinery/pkg/runtime/schema"
27         types "k8s.io/apimachinery/pkg/types"
28         watch "k8s.io/apimachinery/pkg/watch"
29         testing "k8s.io/client-go/testing"
30 )
31
32 // FakeReplicaSets implements ReplicaSetInterface
33 type FakeReplicaSets struct {
34         Fake *FakeAppsV1
35         ns   string
36 }
37
38 var replicasetsResource = schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "replicasets"}
39
40 var replicasetsKind = schema.GroupVersionKind{Group: "apps", Version: "v1", Kind: "ReplicaSet"}
41
42 // Get takes name of the replicaSet, and returns the corresponding replicaSet object, and an error if there is any.
43 func (c *FakeReplicaSets) Get(name string, options v1.GetOptions) (result *appsv1.ReplicaSet, err error) {
44         obj, err := c.Fake.
45                 Invokes(testing.NewGetAction(replicasetsResource, c.ns, name), &appsv1.ReplicaSet{})
46
47         if obj == nil {
48                 return nil, err
49         }
50         return obj.(*appsv1.ReplicaSet), err
51 }
52
53 // List takes label and field selectors, and returns the list of ReplicaSets that match those selectors.
54 func (c *FakeReplicaSets) List(opts v1.ListOptions) (result *appsv1.ReplicaSetList, err error) {
55         obj, err := c.Fake.
56                 Invokes(testing.NewListAction(replicasetsResource, replicasetsKind, c.ns, opts), &appsv1.ReplicaSetList{})
57
58         if obj == nil {
59                 return nil, err
60         }
61
62         label, _, _ := testing.ExtractFromListOptions(opts)
63         if label == nil {
64                 label = labels.Everything()
65         }
66         list := &appsv1.ReplicaSetList{ListMeta: obj.(*appsv1.ReplicaSetList).ListMeta}
67         for _, item := range obj.(*appsv1.ReplicaSetList).Items {
68                 if label.Matches(labels.Set(item.Labels)) {
69                         list.Items = append(list.Items, item)
70                 }
71         }
72         return list, err
73 }
74
75 // Watch returns a watch.Interface that watches the requested replicaSets.
76 func (c *FakeReplicaSets) Watch(opts v1.ListOptions) (watch.Interface, error) {
77         return c.Fake.
78                 InvokesWatch(testing.NewWatchAction(replicasetsResource, c.ns, opts))
79
80 }
81
82 // Create takes the representation of a replicaSet and creates it.  Returns the server's representation of the replicaSet, and an error, if there is any.
83 func (c *FakeReplicaSets) Create(replicaSet *appsv1.ReplicaSet) (result *appsv1.ReplicaSet, err error) {
84         obj, err := c.Fake.
85                 Invokes(testing.NewCreateAction(replicasetsResource, c.ns, replicaSet), &appsv1.ReplicaSet{})
86
87         if obj == nil {
88                 return nil, err
89         }
90         return obj.(*appsv1.ReplicaSet), err
91 }
92
93 // Update takes the representation of a replicaSet and updates it. Returns the server's representation of the replicaSet, and an error, if there is any.
94 func (c *FakeReplicaSets) Update(replicaSet *appsv1.ReplicaSet) (result *appsv1.ReplicaSet, err error) {
95         obj, err := c.Fake.
96                 Invokes(testing.NewUpdateAction(replicasetsResource, c.ns, replicaSet), &appsv1.ReplicaSet{})
97
98         if obj == nil {
99                 return nil, err
100         }
101         return obj.(*appsv1.ReplicaSet), err
102 }
103
104 // UpdateStatus was generated because the type contains a Status member.
105 // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
106 func (c *FakeReplicaSets) UpdateStatus(replicaSet *appsv1.ReplicaSet) (*appsv1.ReplicaSet, error) {
107         obj, err := c.Fake.
108                 Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "status", c.ns, replicaSet), &appsv1.ReplicaSet{})
109
110         if obj == nil {
111                 return nil, err
112         }
113         return obj.(*appsv1.ReplicaSet), err
114 }
115
116 // Delete takes name of the replicaSet and deletes it. Returns an error if one occurs.
117 func (c *FakeReplicaSets) Delete(name string, options *v1.DeleteOptions) error {
118         _, err := c.Fake.
119                 Invokes(testing.NewDeleteAction(replicasetsResource, c.ns, name), &appsv1.ReplicaSet{})
120
121         return err
122 }
123
124 // DeleteCollection deletes a collection of objects.
125 func (c *FakeReplicaSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
126         action := testing.NewDeleteCollectionAction(replicasetsResource, c.ns, listOptions)
127
128         _, err := c.Fake.Invokes(action, &appsv1.ReplicaSetList{})
129         return err
130 }
131
132 // Patch applies the patch and returns the patched replicaSet.
133 func (c *FakeReplicaSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *appsv1.ReplicaSet, err error) {
134         obj, err := c.Fake.
135                 Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, name, pt, data, subresources...), &appsv1.ReplicaSet{})
136
137         if obj == nil {
138                 return nil, err
139         }
140         return obj.(*appsv1.ReplicaSet), err
141 }
142
143 // GetScale takes name of the replicaSet, and returns the corresponding scale object, and an error if there is any.
144 func (c *FakeReplicaSets) GetScale(replicaSetName string, options v1.GetOptions) (result *autoscalingv1.Scale, err error) {
145         obj, err := c.Fake.
146                 Invokes(testing.NewGetSubresourceAction(replicasetsResource, c.ns, "scale", replicaSetName), &autoscalingv1.Scale{})
147
148         if obj == nil {
149                 return nil, err
150         }
151         return obj.(*autoscalingv1.Scale), err
152 }
153
154 // UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
155 func (c *FakeReplicaSets) UpdateScale(replicaSetName string, scale *autoscalingv1.Scale) (result *autoscalingv1.Scale, err error) {
156         obj, err := c.Fake.
157                 Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "scale", c.ns, scale), &autoscalingv1.Scale{})
158
159         if obj == nil {
160                 return nil, err
161         }
162         return obj.(*autoscalingv1.Scale), err
163 }