Adding generated code for service chaining
[ovn4nfv-k8s-plugin.git] / pkg / generated / clientset / versioned / typed / k8s / v1alpha1 / fake / fake_networkchaining.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         v1alpha1 "ovn4nfv-k8s-plugin/pkg/apis/k8s/v1alpha1"
23
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 // FakeNetworkChainings implements NetworkChainingInterface
33 type FakeNetworkChainings struct {
34         Fake *FakeK8sV1alpha1
35         ns   string
36 }
37
38 var networkchainingsResource = schema.GroupVersionResource{Group: "k8s.plugin.opnfv.org", Version: "v1alpha1", Resource: "networkchainings"}
39
40 var networkchainingsKind = schema.GroupVersionKind{Group: "k8s.plugin.opnfv.org", Version: "v1alpha1", Kind: "NetworkChaining"}
41
42 // Get takes name of the networkChaining, and returns the corresponding networkChaining object, and an error if there is any.
43 func (c *FakeNetworkChainings) Get(name string, options v1.GetOptions) (result *v1alpha1.NetworkChaining, err error) {
44         obj, err := c.Fake.
45                 Invokes(testing.NewGetAction(networkchainingsResource, c.ns, name), &v1alpha1.NetworkChaining{})
46
47         if obj == nil {
48                 return nil, err
49         }
50         return obj.(*v1alpha1.NetworkChaining), err
51 }
52
53 // List takes label and field selectors, and returns the list of NetworkChainings that match those selectors.
54 func (c *FakeNetworkChainings) List(opts v1.ListOptions) (result *v1alpha1.NetworkChainingList, err error) {
55         obj, err := c.Fake.
56                 Invokes(testing.NewListAction(networkchainingsResource, networkchainingsKind, c.ns, opts), &v1alpha1.NetworkChainingList{})
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 := &v1alpha1.NetworkChainingList{ListMeta: obj.(*v1alpha1.NetworkChainingList).ListMeta}
67         for _, item := range obj.(*v1alpha1.NetworkChainingList).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 networkChainings.
76 func (c *FakeNetworkChainings) Watch(opts v1.ListOptions) (watch.Interface, error) {
77         return c.Fake.
78                 InvokesWatch(testing.NewWatchAction(networkchainingsResource, c.ns, opts))
79
80 }
81
82 // Create takes the representation of a networkChaining and creates it.  Returns the server's representation of the networkChaining, and an error, if there is any.
83 func (c *FakeNetworkChainings) Create(networkChaining *v1alpha1.NetworkChaining) (result *v1alpha1.NetworkChaining, err error) {
84         obj, err := c.Fake.
85                 Invokes(testing.NewCreateAction(networkchainingsResource, c.ns, networkChaining), &v1alpha1.NetworkChaining{})
86
87         if obj == nil {
88                 return nil, err
89         }
90         return obj.(*v1alpha1.NetworkChaining), err
91 }
92
93 // Update takes the representation of a networkChaining and updates it. Returns the server's representation of the networkChaining, and an error, if there is any.
94 func (c *FakeNetworkChainings) Update(networkChaining *v1alpha1.NetworkChaining) (result *v1alpha1.NetworkChaining, err error) {
95         obj, err := c.Fake.
96                 Invokes(testing.NewUpdateAction(networkchainingsResource, c.ns, networkChaining), &v1alpha1.NetworkChaining{})
97
98         if obj == nil {
99                 return nil, err
100         }
101         return obj.(*v1alpha1.NetworkChaining), 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 *FakeNetworkChainings) UpdateStatus(networkChaining *v1alpha1.NetworkChaining) (*v1alpha1.NetworkChaining, error) {
107         obj, err := c.Fake.
108                 Invokes(testing.NewUpdateSubresourceAction(networkchainingsResource, "status", c.ns, networkChaining), &v1alpha1.NetworkChaining{})
109
110         if obj == nil {
111                 return nil, err
112         }
113         return obj.(*v1alpha1.NetworkChaining), err
114 }
115
116 // Delete takes name of the networkChaining and deletes it. Returns an error if one occurs.
117 func (c *FakeNetworkChainings) Delete(name string, options *v1.DeleteOptions) error {
118         _, err := c.Fake.
119                 Invokes(testing.NewDeleteAction(networkchainingsResource, c.ns, name), &v1alpha1.NetworkChaining{})
120
121         return err
122 }
123
124 // DeleteCollection deletes a collection of objects.
125 func (c *FakeNetworkChainings) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
126         action := testing.NewDeleteCollectionAction(networkchainingsResource, c.ns, listOptions)
127
128         _, err := c.Fake.Invokes(action, &v1alpha1.NetworkChainingList{})
129         return err
130 }
131
132 // Patch applies the patch and returns the patched networkChaining.
133 func (c *FakeNetworkChainings) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.NetworkChaining, err error) {
134         obj, err := c.Fake.
135                 Invokes(testing.NewPatchSubresourceAction(networkchainingsResource, c.ns, name, pt, data, subresources...), &v1alpha1.NetworkChaining{})
136
137         if obj == nil {
138                 return nil, err
139         }
140         return obj.(*v1alpha1.NetworkChaining), err
141 }