2 Copyright The Kubernetes Authors.
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
8 http://www.apache.org/licenses/LICENSE-2.0
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.
17 // Code generated by client-gen. DO NOT EDIT.
22 corev1 "k8s.io/api/core/v1"
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"
31 // FakeResourceQuotas implements ResourceQuotaInterface
32 type FakeResourceQuotas struct {
37 var resourcequotasResource = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "resourcequotas"}
39 var resourcequotasKind = schema.GroupVersionKind{Group: "", Version: "v1", Kind: "ResourceQuota"}
41 // Get takes name of the resourceQuota, and returns the corresponding resourceQuota object, and an error if there is any.
42 func (c *FakeResourceQuotas) Get(name string, options v1.GetOptions) (result *corev1.ResourceQuota, err error) {
44 Invokes(testing.NewGetAction(resourcequotasResource, c.ns, name), &corev1.ResourceQuota{})
49 return obj.(*corev1.ResourceQuota), err
52 // List takes label and field selectors, and returns the list of ResourceQuotas that match those selectors.
53 func (c *FakeResourceQuotas) List(opts v1.ListOptions) (result *corev1.ResourceQuotaList, err error) {
55 Invokes(testing.NewListAction(resourcequotasResource, resourcequotasKind, c.ns, opts), &corev1.ResourceQuotaList{})
61 label, _, _ := testing.ExtractFromListOptions(opts)
63 label = labels.Everything()
65 list := &corev1.ResourceQuotaList{ListMeta: obj.(*corev1.ResourceQuotaList).ListMeta}
66 for _, item := range obj.(*corev1.ResourceQuotaList).Items {
67 if label.Matches(labels.Set(item.Labels)) {
68 list.Items = append(list.Items, item)
74 // Watch returns a watch.Interface that watches the requested resourceQuotas.
75 func (c *FakeResourceQuotas) Watch(opts v1.ListOptions) (watch.Interface, error) {
77 InvokesWatch(testing.NewWatchAction(resourcequotasResource, c.ns, opts))
81 // Create takes the representation of a resourceQuota and creates it. Returns the server's representation of the resourceQuota, and an error, if there is any.
82 func (c *FakeResourceQuotas) Create(resourceQuota *corev1.ResourceQuota) (result *corev1.ResourceQuota, err error) {
84 Invokes(testing.NewCreateAction(resourcequotasResource, c.ns, resourceQuota), &corev1.ResourceQuota{})
89 return obj.(*corev1.ResourceQuota), err
92 // Update takes the representation of a resourceQuota and updates it. Returns the server's representation of the resourceQuota, and an error, if there is any.
93 func (c *FakeResourceQuotas) Update(resourceQuota *corev1.ResourceQuota) (result *corev1.ResourceQuota, err error) {
95 Invokes(testing.NewUpdateAction(resourcequotasResource, c.ns, resourceQuota), &corev1.ResourceQuota{})
100 return obj.(*corev1.ResourceQuota), err
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 *FakeResourceQuotas) UpdateStatus(resourceQuota *corev1.ResourceQuota) (*corev1.ResourceQuota, error) {
107 Invokes(testing.NewUpdateSubresourceAction(resourcequotasResource, "status", c.ns, resourceQuota), &corev1.ResourceQuota{})
112 return obj.(*corev1.ResourceQuota), err
115 // Delete takes name of the resourceQuota and deletes it. Returns an error if one occurs.
116 func (c *FakeResourceQuotas) Delete(name string, options *v1.DeleteOptions) error {
118 Invokes(testing.NewDeleteAction(resourcequotasResource, c.ns, name), &corev1.ResourceQuota{})
123 // DeleteCollection deletes a collection of objects.
124 func (c *FakeResourceQuotas) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
125 action := testing.NewDeleteCollectionAction(resourcequotasResource, c.ns, listOptions)
127 _, err := c.Fake.Invokes(action, &corev1.ResourceQuotaList{})
131 // Patch applies the patch and returns the patched resourceQuota.
132 func (c *FakeResourceQuotas) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *corev1.ResourceQuota, err error) {
134 Invokes(testing.NewPatchSubresourceAction(resourcequotasResource, c.ns, name, pt, data, subresources...), &corev1.ResourceQuota{})
139 return obj.(*corev1.ResourceQuota), err