diff --git a/Gopkg.lock b/Gopkg.lock index ea06aa3..9f3c770 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -17,6 +17,14 @@ pruneopts = "NT" revision = "de5bf2ad457846296e2031421a34e2568e304e35" +[[projects]] + digest = "1:4b8b5811da6970495e04d1f4e98bb89518cc3cfc3b3f456bdb876ed7b6c74049" + name = "github.com/davecgh/go-spew" + packages = ["spew"] + pruneopts = "NT" + revision = "8991bc29aa16c548c550c7ff78260e27b9ab7c73" + version = "v1.1.1" + [[projects]] digest = "1:1302bdd23af4264a095d48c2c28660a8ecf2e02454ce172cef5cb946029a1383" name = "github.com/emicklei/go-restful" @@ -28,6 +36,14 @@ revision = "b9bbc5664f49b6deec52393bd68f39830687a347" version = "v2.9.3" +[[projects]] + digest = "1:4322fcb2f4d508898c3d9b0390a2e58211b53e6d9c25230b225df9a032fe26d6" + name = "github.com/evanphx/json-patch" + packages = ["."] + pruneopts = "NT" + revision = "5858425f75500d40c52783dce87d085a483ce135" + version = "v4.2.0" + [[projects]] digest = "1:81466b4218bf6adddac2572a30ac733a9255919bc2f470b4827a317bd4ee1756" name = "github.com/ghodss/yaml" @@ -95,6 +111,28 @@ pruneopts = "NT" revision = "23def4e6c14b4da8ac2ed8007337bc5eb5007998" +[[projects]] + digest = "1:d7212166c4b7f30a20fb3de70ab7e36564900b2e36360ffd31958b5af8fed025" + name = "github.com/golang/protobuf" + packages = [ + "proto", + "ptypes", + "ptypes/any", + "ptypes/duration", + "ptypes/timestamp", + ] + pruneopts = "NT" + revision = "b5d812f8a3706043e23a9cd5babf2e5423744d30" + version = "v1.3.1" + +[[projects]] + digest = "1:05f95ffdfcf651bdb0f05b40b69e7f5663047f8da75c72d58728acb59b5cc107" + name = "github.com/google/btree" + packages = ["."] + pruneopts = "NT" + revision = "4030bb1f1f0c35b30ca7009e9ebd06849dd45306" + version = "v1.0.0" + [[projects]] digest = "1:52c5834e2bebac9030c97cc0798ac11c3aa8a39f098aeb419f142533da6cd3cc" name = "github.com/google/gofuzz" @@ -103,6 +141,29 @@ revision = "f140a6486e521aad38f5917de355cbf147cc0496" version = "v1.0.0" +[[projects]] + digest = "1:289332c13b80edfefc88397cce5266c16845dcf204fa2f6ac7e464ee4c7f6e96" + name = "github.com/googleapis/gnostic" + packages = [ + "OpenAPIv2", + "compiler", + "extensions", + ] + pruneopts = "NT" + revision = "7c663266750e7d82587642f65e60bc4083f1f84e" + version = "v0.2.0" + +[[projects]] + branch = "master" + digest = "1:bb7bd892abcb75ef819ce2efab9d54d22b7e38dc05ffac55428bb0578b52912b" + name = "github.com/gregjones/httpcache" + packages = [ + ".", + "diskcache", + ] + pruneopts = "NT" + revision = "3befbb6ad0cc97d4c25d851e9528915809e1a22f" + [[projects]] digest = "1:f5b9328966ccea0970b1d15075698eff0ddb3e75889560aad2e9f76b289b536a" name = "github.com/joho/godotenv" @@ -155,6 +216,22 @@ revision = "4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd" version = "1.0.1" +[[projects]] + branch = "master" + digest = "1:ca71dc35a821dd1d5cef16dab21648793f0c675297bfda31eaa0175d0eafd26f" + name = "github.com/petar/GoLLRB" + packages = ["llrb"] + pruneopts = "NT" + revision = "33fb24c13b99c46c93183c291836c573ac382536" + +[[projects]] + digest = "1:d8139b87c97ab035e546f58bb812ec6eb11518ec7dff03694e5427bc67ca7c0f" + name = "github.com/peterbourgon/diskv" + packages = ["."] + pruneopts = "NT" + revision = "0be1b92a6df0e4f5cb0a5d15fb7f643d0ad93ce6" + version = "v3.0.0" + [[projects]] digest = "1:14715f705ff5dfe0ffd6571d7d201dd8e921030f8070321a79380d8ca4ec1a24" name = "github.com/pkg/errors" @@ -194,11 +271,21 @@ revision = "298182f68c66c05229eb03ac171abe6e309ee79a" version = "v1.0.3" +[[projects]] + branch = "master" + digest = "1:af1fe3e40e947f75bee6d1f3b3610fa859079ddc4706634d5360213d7e70b954" + name = "golang.org/x/crypto" + packages = ["ssh/terminal"] + pruneopts = "NT" + revision = "22d7a77e9e5f409e934ed268692e56707cd169e5" + [[projects]] branch = "master" digest = "1:940590250ff6229f11678ea802c15e75768bf39b6440d24025bc5bede1f40367" name = "golang.org/x/net" packages = [ + "context", + "context/ctxhttp", "http/httpguts", "http2", "http2/hpack", @@ -207,6 +294,28 @@ pruneopts = "NT" revision = "4829fb13d2c62012c17688fa7f629f371014946d" +[[projects]] + branch = "master" + digest = "1:54c605b4036ec49dbc4c887969128d5ee68140cf0bbec46e67cbb2497e69c15e" + name = "golang.org/x/oauth2" + packages = [ + ".", + "internal", + ] + pruneopts = "NT" + revision = "9f3314589c9a9136388751d9adae6b0ed400978a" + +[[projects]] + branch = "master" + digest = "1:47fc964e3233a4398af2c50ccd963f080337e097c7ef089a9ebea67bcb07ec4f" + name = "golang.org/x/sys" + packages = [ + "unix", + "windows", + ] + pruneopts = "NT" + revision = "3a4b5fb9f71f5874b2374ae059bc0e0bcb52e145" + [[projects]] digest = "1:bce3b076d7b21ce3bc1fbc868222c86852e424762ec9b3e4bfc76f29805342f8" name = "golang.org/x/text" @@ -233,6 +342,14 @@ revision = "c942b20a5d85b458c4dce1589326051d85e25d6d" version = "v0.3.1" +[[projects]] + branch = "master" + digest = "1:9fdc2b55e8e0fafe4b41884091e51e77344f7dc511c5acedcfd98200003bff90" + name = "golang.org/x/time" + packages = ["rate"] + pruneopts = "NT" + revision = "9d24e82272b4f38b78bc8cff74fa936d31ccd8ef" + [[projects]] branch = "master" digest = "1:76c0816d46d54b4a0f4287be305b0f8d1d95c4283d65c6d54da47cd7db5b08c4" @@ -253,6 +370,22 @@ pruneopts = "NT" revision = "cb2dda6eabdf9160e66ca7293897f984154a7f8b" +[[projects]] + digest = "1:d85bd4497eba4bba5620f30ba3b7bc3e2d5d73b85dd494eeb6ad79c73cdc23a3" + name = "google.golang.org/appengine" + packages = [ + "internal", + "internal/base", + "internal/datastore", + "internal/log", + "internal/remote_api", + "internal/urlfetch", + "urlfetch", + ] + pruneopts = "NT" + revision = "4c25cacc810c02874000e4f7071286a8e96b2515" + version = "v1.6.0" + [[projects]] digest = "1:2d1fbdc6777e5408cabeb02bf336305e724b925ff4546ded0fa8715a7267922a" name = "gopkg.in/inf.v0" @@ -272,7 +405,40 @@ [[projects]] digest = "1:18b9b70bdf29da610c0df032cf60ee7526a48756fa44012cc639dcb557335cbc" name = "k8s.io/api" - packages = ["rbac/v1"] + packages = [ + "admissionregistration/v1alpha1", + "admissionregistration/v1beta1", + "apps/v1", + "apps/v1beta1", + "apps/v1beta2", + "auditregistration/v1alpha1", + "authentication/v1", + "authentication/v1beta1", + "authorization/v1", + "authorization/v1beta1", + "autoscaling/v1", + "autoscaling/v2beta1", + "autoscaling/v2beta2", + "batch/v1", + "batch/v1beta1", + "batch/v2alpha1", + "certificates/v1beta1", + "coordination/v1beta1", + "core/v1", + "events/v1beta1", + "extensions/v1beta1", + "networking/v1", + "policy/v1beta1", + "rbac/v1", + "rbac/v1alpha1", + "rbac/v1beta1", + "scheduling/v1alpha1", + "scheduling/v1beta1", + "settings/v1alpha1", + "storage/v1", + "storage/v1alpha1", + "storage/v1beta1", + ] pruneopts = "NT" revision = "5cb15d34447165a97c76ed5a60e4e99c8a01ecfe" version = "kubernetes-1.13.4" @@ -292,32 +458,76 @@ digest = "1:f44b5a32a31245ea062cd397cc343bda06d75c731596589996c1f77634e653af" name = "k8s.io/apimachinery" packages = [ + "pkg/api/errors", + "pkg/api/meta", "pkg/api/resource", "pkg/apis/meta/v1", + "pkg/apis/meta/v1/unstructured", + "pkg/apis/meta/v1beta1", "pkg/conversion", "pkg/conversion/queryparams", "pkg/fields", "pkg/labels", "pkg/runtime", "pkg/runtime/schema", + "pkg/runtime/serializer", + "pkg/runtime/serializer/json", + "pkg/runtime/serializer/protobuf", + "pkg/runtime/serializer/recognizer", + "pkg/runtime/serializer/streaming", + "pkg/runtime/serializer/versioning", "pkg/selection", "pkg/types", + "pkg/util/clock", "pkg/util/errors", + "pkg/util/framer", "pkg/util/intstr", "pkg/util/json", + "pkg/util/mergepatch", "pkg/util/naming", "pkg/util/net", "pkg/util/runtime", "pkg/util/sets", + "pkg/util/strategicpatch", "pkg/util/validation", "pkg/util/validation/field", + "pkg/util/yaml", + "pkg/version", "pkg/watch", + "third_party/forked/golang/json", "third_party/forked/golang/reflect", ] pruneopts = "NT" revision = "86fb29eff6288413d76bd8506874fddd9fccdff0" version = "kubernetes-1.13.4" +[[projects]] + digest = "1:7f28bbfb5889618ab038d4d250d7adb6762aa43b2fc120a95a1cd47c68af6dd4" + name = "k8s.io/client-go" + packages = [ + "discovery", + "discovery/fake", + "kubernetes/scheme", + "pkg/apis/clientauthentication", + "pkg/apis/clientauthentication/v1alpha1", + "pkg/apis/clientauthentication/v1beta1", + "pkg/version", + "plugin/pkg/client/auth/exec", + "rest", + "rest/watch", + "testing", + "tools/clientcmd/api", + "tools/metrics", + "transport", + "util/cert", + "util/connrotation", + "util/flowcontrol", + "util/integer", + ] + pruneopts = "NT" + revision = "b40b2a5939e43f7ffe0028ad67586b7ce50bb675" + version = "kubernetes-1.13.4" + [[projects]] digest = "1:dc1ae99dcab96913d81ae970b1f7a7411a54199b14bfb17a7e86f9a56979c720" name = "k8s.io/code-generator" @@ -382,6 +592,7 @@ "pkg/common", "pkg/generators", "pkg/generators/rules", + "pkg/util/proto", "pkg/util/sets", ] pruneopts = "NT" @@ -410,14 +621,32 @@ revision = "950a0e88e4effb864253b3c7504b326cc83b9d11" version = "v0.1.8" +[[projects]] + digest = "1:8730e0150dfb2b7e173890c8b9868e7a273082ef8e39f4940e3506a481cf895c" + name = "sigs.k8s.io/yaml" + packages = ["."] + pruneopts = "NT" + revision = "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" + version = "v1.1.0" + [solve-meta] analyzer-name = "dep" analyzer-version = 1 input-imports = [ "github.com/go-openapi/spec", "k8s.io/apimachinery/pkg/apis/meta/v1", + "k8s.io/apimachinery/pkg/labels", "k8s.io/apimachinery/pkg/runtime", "k8s.io/apimachinery/pkg/runtime/schema", + "k8s.io/apimachinery/pkg/runtime/serializer", + "k8s.io/apimachinery/pkg/types", + "k8s.io/apimachinery/pkg/util/runtime", + "k8s.io/apimachinery/pkg/watch", + "k8s.io/client-go/discovery", + "k8s.io/client-go/discovery/fake", + "k8s.io/client-go/rest", + "k8s.io/client-go/testing", + "k8s.io/client-go/util/flowcontrol", "k8s.io/code-generator/cmd/client-gen", "k8s.io/code-generator/cmd/conversion-gen", "k8s.io/code-generator/cmd/deepcopy-gen", diff --git a/Gopkg.toml b/Gopkg.toml index 9966adc..7b6652b 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -58,4 +58,3 @@ required = [ [[prune.project]] name = "k8s.io/gengo" non-go = false - diff --git a/pkg/apis/devconsole/v1alpha1/component_types.go b/pkg/apis/devconsole/v1alpha1/component_types.go index 4fe325c..9d76db0 100644 --- a/pkg/apis/devconsole/v1alpha1/component_types.go +++ b/pkg/apis/devconsole/v1alpha1/component_types.go @@ -37,6 +37,7 @@ const ( PhaseDeployed string = "Deployed" ) +// +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Component is the Schema for the components API. diff --git a/pkg/apis/devconsole/v1alpha1/gitsource_types.go b/pkg/apis/devconsole/v1alpha1/gitsource_types.go index 2a9d6e9..644c020 100644 --- a/pkg/apis/devconsole/v1alpha1/gitsource_types.go +++ b/pkg/apis/devconsole/v1alpha1/gitsource_types.go @@ -81,6 +81,7 @@ type Connection struct { // ConnectionState is the result of the attempt to reach a GitSource. type ConnectionState string + // ConnectionFailureReason represents the reason why the attempt to reach a GitSource failed type ConnectionFailureReason string @@ -101,6 +102,7 @@ const ( ConnectionInternalFailure ConnectionFailureReason = "InternalFailure" ) +// +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // GitSource is the Schema for the gitsources API diff --git a/pkg/apis/devconsole/v1alpha1/gitsourceanalysis_types.go b/pkg/apis/devconsole/v1alpha1/gitsourceanalysis_types.go index 0448dbc..d3eba0f 100644 --- a/pkg/apis/devconsole/v1alpha1/gitsourceanalysis_types.go +++ b/pkg/apis/devconsole/v1alpha1/gitsourceanalysis_types.go @@ -73,6 +73,7 @@ type DetectedBuildType struct { DetectedFiles []string `json:"detectedFiles,omitempty"` } +// +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // GitSourceAnalysis is the Schema for the gitsourceanalyses API diff --git a/pkg/apis/devconsole/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/devconsole/v1alpha1/zz_generated.deepcopy.go index 748b86e..fee7908 100644 --- a/pkg/apis/devconsole/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/devconsole/v1alpha1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by main. DO NOT EDIT. +// Code generated by deepcopy-gen. DO NOT EDIT. package v1alpha1 diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go new file mode 100644 index 0000000..7c3654e --- /dev/null +++ b/pkg/client/clientset/versioned/clientset.go @@ -0,0 +1,90 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package versioned + +import ( + devconsolev1alpha1 "github.com/redhat-developer/devconsole-api/pkg/client/clientset/versioned/typed/devconsole/v1alpha1" + discovery "k8s.io/client-go/discovery" + rest "k8s.io/client-go/rest" + flowcontrol "k8s.io/client-go/util/flowcontrol" +) + +type Interface interface { + Discovery() discovery.DiscoveryInterface + DevconsoleV1alpha1() devconsolev1alpha1.DevconsoleV1alpha1Interface +} + +// Clientset contains the clients for groups. Each group has exactly one +// version included in a Clientset. +type Clientset struct { + *discovery.DiscoveryClient + devconsoleV1alpha1 *devconsolev1alpha1.DevconsoleV1alpha1Client +} + +// DevconsoleV1alpha1 retrieves the DevconsoleV1alpha1Client +func (c *Clientset) DevconsoleV1alpha1() devconsolev1alpha1.DevconsoleV1alpha1Interface { + return c.devconsoleV1alpha1 +} + +// Discovery retrieves the DiscoveryClient +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + if c == nil { + return nil + } + return c.DiscoveryClient +} + +// NewForConfig creates a new Clientset for the given config. +func NewForConfig(c *rest.Config) (*Clientset, error) { + configShallowCopy := *c + if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { + configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) + } + var cs Clientset + var err error + cs.devconsoleV1alpha1, err = devconsolev1alpha1.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } + + cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) + if err != nil { + return nil, err + } + return &cs, nil +} + +// NewForConfigOrDie creates a new Clientset for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *Clientset { + var cs Clientset + cs.devconsoleV1alpha1 = devconsolev1alpha1.NewForConfigOrDie(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) + return &cs +} + +// New creates a new Clientset for the given RESTClient. +func New(c rest.Interface) *Clientset { + var cs Clientset + cs.devconsoleV1alpha1 = devconsolev1alpha1.New(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClient(c) + return &cs +} diff --git a/pkg/client/clientset/versioned/doc.go b/pkg/client/clientset/versioned/doc.go new file mode 100644 index 0000000..41721ca --- /dev/null +++ b/pkg/client/clientset/versioned/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated clientset. +package versioned diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go new file mode 100644 index 0000000..cff3e17 --- /dev/null +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -0,0 +1,82 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + clientset "github.com/redhat-developer/devconsole-api/pkg/client/clientset/versioned" + devconsolev1alpha1 "github.com/redhat-developer/devconsole-api/pkg/client/clientset/versioned/typed/devconsole/v1alpha1" + fakedevconsolev1alpha1 "github.com/redhat-developer/devconsole-api/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/fake" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" +) + +// NewSimpleClientset returns a clientset that will respond with the provided objects. +// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, +// without applying any validations and/or defaults. It shouldn't be considered a replacement +// for a real clientset and is mostly useful in simple unit tests. +func NewSimpleClientset(objects ...runtime.Object) *Clientset { + o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) + for _, obj := range objects { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + cs := &Clientset{tracker: o} + cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} + cs.AddReactor("*", "*", testing.ObjectReaction(o)) + cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) + + return cs +} + +// Clientset implements clientset.Interface. Meant to be embedded into a +// struct to get a default implementation. This makes faking out just the method +// you want to test easier. +type Clientset struct { + testing.Fake + discovery *fakediscovery.FakeDiscovery + tracker testing.ObjectTracker +} + +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + return c.discovery +} + +func (c *Clientset) Tracker() testing.ObjectTracker { + return c.tracker +} + +var _ clientset.Interface = &Clientset{} + +// DevconsoleV1alpha1 retrieves the DevconsoleV1alpha1Client +func (c *Clientset) DevconsoleV1alpha1() devconsolev1alpha1.DevconsoleV1alpha1Interface { + return &fakedevconsolev1alpha1.FakeDevconsoleV1alpha1{Fake: &c.Fake} +} diff --git a/pkg/client/clientset/versioned/fake/doc.go b/pkg/client/clientset/versioned/fake/doc.go new file mode 100644 index 0000000..9b99e71 --- /dev/null +++ b/pkg/client/clientset/versioned/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated fake clientset. +package fake diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go new file mode 100644 index 0000000..448e169 --- /dev/null +++ b/pkg/client/clientset/versioned/fake/register.go @@ -0,0 +1,56 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + devconsolev1alpha1 "github.com/redhat-developer/devconsole-api/pkg/apis/devconsole/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" +) + +var scheme = runtime.NewScheme() +var codecs = serializer.NewCodecFactory(scheme) +var parameterCodec = runtime.NewParameterCodec(scheme) +var localSchemeBuilder = runtime.SchemeBuilder{ + devconsolev1alpha1.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(scheme)) +} diff --git a/pkg/client/clientset/versioned/scheme/doc.go b/pkg/client/clientset/versioned/scheme/doc.go new file mode 100644 index 0000000..7dc3756 --- /dev/null +++ b/pkg/client/clientset/versioned/scheme/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package contains the scheme of the automatically generated clientset. +package scheme diff --git a/pkg/client/clientset/versioned/scheme/register.go b/pkg/client/clientset/versioned/scheme/register.go new file mode 100644 index 0000000..abc867d --- /dev/null +++ b/pkg/client/clientset/versioned/scheme/register.go @@ -0,0 +1,56 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package scheme + +import ( + devconsolev1alpha1 "github.com/redhat-developer/devconsole-api/pkg/apis/devconsole/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" +) + +var Scheme = runtime.NewScheme() +var Codecs = serializer.NewCodecFactory(Scheme) +var ParameterCodec = runtime.NewParameterCodec(Scheme) +var localSchemeBuilder = runtime.SchemeBuilder{ + devconsolev1alpha1.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(Scheme)) +} diff --git a/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/component.go b/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/component.go new file mode 100644 index 0000000..3e3f901 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/component.go @@ -0,0 +1,191 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "time" + + v1alpha1 "github.com/redhat-developer/devconsole-api/pkg/apis/devconsole/v1alpha1" + scheme "github.com/redhat-developer/devconsole-api/pkg/client/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// ComponentsGetter has a method to return a ComponentInterface. +// A group's client should implement this interface. +type ComponentsGetter interface { + Components(namespace string) ComponentInterface +} + +// ComponentInterface has methods to work with Component resources. +type ComponentInterface interface { + Create(*v1alpha1.Component) (*v1alpha1.Component, error) + Update(*v1alpha1.Component) (*v1alpha1.Component, error) + UpdateStatus(*v1alpha1.Component) (*v1alpha1.Component, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1alpha1.Component, error) + List(opts v1.ListOptions) (*v1alpha1.ComponentList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Component, err error) + ComponentExpansion +} + +// components implements ComponentInterface +type components struct { + client rest.Interface + ns string +} + +// newComponents returns a Components +func newComponents(c *DevconsoleV1alpha1Client, namespace string) *components { + return &components{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the component, and returns the corresponding component object, and an error if there is any. +func (c *components) Get(name string, options v1.GetOptions) (result *v1alpha1.Component, err error) { + result = &v1alpha1.Component{} + err = c.client.Get(). + Namespace(c.ns). + Resource("components"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Components that match those selectors. +func (c *components) List(opts v1.ListOptions) (result *v1alpha1.ComponentList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.ComponentList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("components"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested components. +func (c *components) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("components"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch() +} + +// Create takes the representation of a component and creates it. Returns the server's representation of the component, and an error, if there is any. +func (c *components) Create(component *v1alpha1.Component) (result *v1alpha1.Component, err error) { + result = &v1alpha1.Component{} + err = c.client.Post(). + Namespace(c.ns). + Resource("components"). + Body(component). + Do(). + Into(result) + return +} + +// Update takes the representation of a component and updates it. Returns the server's representation of the component, and an error, if there is any. +func (c *components) Update(component *v1alpha1.Component) (result *v1alpha1.Component, err error) { + result = &v1alpha1.Component{} + err = c.client.Put(). + Namespace(c.ns). + Resource("components"). + Name(component.Name). + Body(component). + Do(). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + +func (c *components) UpdateStatus(component *v1alpha1.Component) (result *v1alpha1.Component, err error) { + result = &v1alpha1.Component{} + err = c.client.Put(). + Namespace(c.ns). + Resource("components"). + Name(component.Name). + SubResource("status"). + Body(component). + Do(). + Into(result) + return +} + +// Delete takes name of the component and deletes it. Returns an error if one occurs. +func (c *components) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("components"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *components) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("components"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched component. +func (c *components) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Component, err error) { + result = &v1alpha1.Component{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("components"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/devconsole_client.go b/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/devconsole_client.go new file mode 100644 index 0000000..58e1c2b --- /dev/null +++ b/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/devconsole_client.go @@ -0,0 +1,99 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "github.com/redhat-developer/devconsole-api/pkg/apis/devconsole/v1alpha1" + "github.com/redhat-developer/devconsole-api/pkg/client/clientset/versioned/scheme" + rest "k8s.io/client-go/rest" +) + +type DevconsoleV1alpha1Interface interface { + RESTClient() rest.Interface + ComponentsGetter + GitSourcesGetter + GitSourceAnalysisesGetter +} + +// DevconsoleV1alpha1Client is used to interact with features provided by the devconsole.openshift.io group. +type DevconsoleV1alpha1Client struct { + restClient rest.Interface +} + +func (c *DevconsoleV1alpha1Client) Components(namespace string) ComponentInterface { + return newComponents(c, namespace) +} + +func (c *DevconsoleV1alpha1Client) GitSources(namespace string) GitSourceInterface { + return newGitSources(c, namespace) +} + +func (c *DevconsoleV1alpha1Client) GitSourceAnalysises(namespace string) GitSourceAnalysisInterface { + return newGitSourceAnalysises(c, namespace) +} + +// NewForConfig creates a new DevconsoleV1alpha1Client for the given config. +func NewForConfig(c *rest.Config) (*DevconsoleV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &DevconsoleV1alpha1Client{client}, nil +} + +// NewForConfigOrDie creates a new DevconsoleV1alpha1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *DevconsoleV1alpha1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new DevconsoleV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *DevconsoleV1alpha1Client { + return &DevconsoleV1alpha1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1alpha1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *DevconsoleV1alpha1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/doc.go b/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/doc.go new file mode 100644 index 0000000..df51baa --- /dev/null +++ b/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1alpha1 diff --git a/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/fake/doc.go b/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/fake/doc.go new file mode 100644 index 0000000..16f4439 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/fake/fake_component.go b/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/fake/fake_component.go new file mode 100644 index 0000000..efbd370 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/fake/fake_component.go @@ -0,0 +1,140 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/redhat-developer/devconsole-api/pkg/apis/devconsole/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" +) + +// FakeComponents implements ComponentInterface +type FakeComponents struct { + Fake *FakeDevconsoleV1alpha1 + ns string +} + +var componentsResource = schema.GroupVersionResource{Group: "devconsole.openshift.io", Version: "v1alpha1", Resource: "components"} + +var componentsKind = schema.GroupVersionKind{Group: "devconsole.openshift.io", Version: "v1alpha1", Kind: "Component"} + +// Get takes name of the component, and returns the corresponding component object, and an error if there is any. +func (c *FakeComponents) Get(name string, options v1.GetOptions) (result *v1alpha1.Component, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(componentsResource, c.ns, name), &v1alpha1.Component{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.Component), err +} + +// List takes label and field selectors, and returns the list of Components that match those selectors. +func (c *FakeComponents) List(opts v1.ListOptions) (result *v1alpha1.ComponentList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(componentsResource, componentsKind, c.ns, opts), &v1alpha1.ComponentList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.ComponentList{ListMeta: obj.(*v1alpha1.ComponentList).ListMeta} + for _, item := range obj.(*v1alpha1.ComponentList).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 components. +func (c *FakeComponents) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(componentsResource, c.ns, opts)) + +} + +// Create takes the representation of a component and creates it. Returns the server's representation of the component, and an error, if there is any. +func (c *FakeComponents) Create(component *v1alpha1.Component) (result *v1alpha1.Component, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(componentsResource, c.ns, component), &v1alpha1.Component{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.Component), err +} + +// Update takes the representation of a component and updates it. Returns the server's representation of the component, and an error, if there is any. +func (c *FakeComponents) Update(component *v1alpha1.Component) (result *v1alpha1.Component, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(componentsResource, c.ns, component), &v1alpha1.Component{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.Component), 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 *FakeComponents) UpdateStatus(component *v1alpha1.Component) (*v1alpha1.Component, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(componentsResource, "status", c.ns, component), &v1alpha1.Component{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.Component), err +} + +// Delete takes name of the component and deletes it. Returns an error if one occurs. +func (c *FakeComponents) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(componentsResource, c.ns, name), &v1alpha1.Component{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeComponents) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(componentsResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v1alpha1.ComponentList{}) + return err +} + +// Patch applies the patch and returns the patched component. +func (c *FakeComponents) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Component, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(componentsResource, c.ns, name, pt, data, subresources...), &v1alpha1.Component{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.Component), err +} diff --git a/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/fake/fake_devconsole_client.go b/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/fake/fake_devconsole_client.go new file mode 100644 index 0000000..277648a --- /dev/null +++ b/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/fake/fake_devconsole_client.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/redhat-developer/devconsole-api/pkg/client/clientset/versioned/typed/devconsole/v1alpha1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeDevconsoleV1alpha1 struct { + *testing.Fake +} + +func (c *FakeDevconsoleV1alpha1) Components(namespace string) v1alpha1.ComponentInterface { + return &FakeComponents{c, namespace} +} + +func (c *FakeDevconsoleV1alpha1) GitSources(namespace string) v1alpha1.GitSourceInterface { + return &FakeGitSources{c, namespace} +} + +func (c *FakeDevconsoleV1alpha1) GitSourceAnalysises(namespace string) v1alpha1.GitSourceAnalysisInterface { + return &FakeGitSourceAnalysises{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeDevconsoleV1alpha1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/fake/fake_gitsource.go b/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/fake/fake_gitsource.go new file mode 100644 index 0000000..54f49fe --- /dev/null +++ b/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/fake/fake_gitsource.go @@ -0,0 +1,140 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/redhat-developer/devconsole-api/pkg/apis/devconsole/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" +) + +// FakeGitSources implements GitSourceInterface +type FakeGitSources struct { + Fake *FakeDevconsoleV1alpha1 + ns string +} + +var gitsourcesResource = schema.GroupVersionResource{Group: "devconsole.openshift.io", Version: "v1alpha1", Resource: "gitsources"} + +var gitsourcesKind = schema.GroupVersionKind{Group: "devconsole.openshift.io", Version: "v1alpha1", Kind: "GitSource"} + +// Get takes name of the gitSource, and returns the corresponding gitSource object, and an error if there is any. +func (c *FakeGitSources) Get(name string, options v1.GetOptions) (result *v1alpha1.GitSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(gitsourcesResource, c.ns, name), &v1alpha1.GitSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.GitSource), err +} + +// List takes label and field selectors, and returns the list of GitSources that match those selectors. +func (c *FakeGitSources) List(opts v1.ListOptions) (result *v1alpha1.GitSourceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(gitsourcesResource, gitsourcesKind, c.ns, opts), &v1alpha1.GitSourceList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.GitSourceList{ListMeta: obj.(*v1alpha1.GitSourceList).ListMeta} + for _, item := range obj.(*v1alpha1.GitSourceList).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 gitSources. +func (c *FakeGitSources) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(gitsourcesResource, c.ns, opts)) + +} + +// Create takes the representation of a gitSource and creates it. Returns the server's representation of the gitSource, and an error, if there is any. +func (c *FakeGitSources) Create(gitSource *v1alpha1.GitSource) (result *v1alpha1.GitSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(gitsourcesResource, c.ns, gitSource), &v1alpha1.GitSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.GitSource), err +} + +// Update takes the representation of a gitSource and updates it. Returns the server's representation of the gitSource, and an error, if there is any. +func (c *FakeGitSources) Update(gitSource *v1alpha1.GitSource) (result *v1alpha1.GitSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(gitsourcesResource, c.ns, gitSource), &v1alpha1.GitSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.GitSource), 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 *FakeGitSources) UpdateStatus(gitSource *v1alpha1.GitSource) (*v1alpha1.GitSource, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(gitsourcesResource, "status", c.ns, gitSource), &v1alpha1.GitSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.GitSource), err +} + +// Delete takes name of the gitSource and deletes it. Returns an error if one occurs. +func (c *FakeGitSources) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(gitsourcesResource, c.ns, name), &v1alpha1.GitSource{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGitSources) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(gitsourcesResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v1alpha1.GitSourceList{}) + return err +} + +// Patch applies the patch and returns the patched gitSource. +func (c *FakeGitSources) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.GitSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(gitsourcesResource, c.ns, name, pt, data, subresources...), &v1alpha1.GitSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.GitSource), err +} diff --git a/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/fake/fake_gitsourceanalysis.go b/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/fake/fake_gitsourceanalysis.go new file mode 100644 index 0000000..562f434 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/fake/fake_gitsourceanalysis.go @@ -0,0 +1,140 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/redhat-developer/devconsole-api/pkg/apis/devconsole/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" +) + +// FakeGitSourceAnalysises implements GitSourceAnalysisInterface +type FakeGitSourceAnalysises struct { + Fake *FakeDevconsoleV1alpha1 + ns string +} + +var gitsourceanalysisesResource = schema.GroupVersionResource{Group: "devconsole.openshift.io", Version: "v1alpha1", Resource: "gitsourceanalysises"} + +var gitsourceanalysisesKind = schema.GroupVersionKind{Group: "devconsole.openshift.io", Version: "v1alpha1", Kind: "GitSourceAnalysis"} + +// Get takes name of the gitSourceAnalysis, and returns the corresponding gitSourceAnalysis object, and an error if there is any. +func (c *FakeGitSourceAnalysises) Get(name string, options v1.GetOptions) (result *v1alpha1.GitSourceAnalysis, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(gitsourceanalysisesResource, c.ns, name), &v1alpha1.GitSourceAnalysis{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.GitSourceAnalysis), err +} + +// List takes label and field selectors, and returns the list of GitSourceAnalysises that match those selectors. +func (c *FakeGitSourceAnalysises) List(opts v1.ListOptions) (result *v1alpha1.GitSourceAnalysisList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(gitsourceanalysisesResource, gitsourceanalysisesKind, c.ns, opts), &v1alpha1.GitSourceAnalysisList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.GitSourceAnalysisList{ListMeta: obj.(*v1alpha1.GitSourceAnalysisList).ListMeta} + for _, item := range obj.(*v1alpha1.GitSourceAnalysisList).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 gitSourceAnalysises. +func (c *FakeGitSourceAnalysises) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(gitsourceanalysisesResource, c.ns, opts)) + +} + +// Create takes the representation of a gitSourceAnalysis and creates it. Returns the server's representation of the gitSourceAnalysis, and an error, if there is any. +func (c *FakeGitSourceAnalysises) Create(gitSourceAnalysis *v1alpha1.GitSourceAnalysis) (result *v1alpha1.GitSourceAnalysis, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(gitsourceanalysisesResource, c.ns, gitSourceAnalysis), &v1alpha1.GitSourceAnalysis{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.GitSourceAnalysis), err +} + +// Update takes the representation of a gitSourceAnalysis and updates it. Returns the server's representation of the gitSourceAnalysis, and an error, if there is any. +func (c *FakeGitSourceAnalysises) Update(gitSourceAnalysis *v1alpha1.GitSourceAnalysis) (result *v1alpha1.GitSourceAnalysis, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(gitsourceanalysisesResource, c.ns, gitSourceAnalysis), &v1alpha1.GitSourceAnalysis{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.GitSourceAnalysis), 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 *FakeGitSourceAnalysises) UpdateStatus(gitSourceAnalysis *v1alpha1.GitSourceAnalysis) (*v1alpha1.GitSourceAnalysis, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(gitsourceanalysisesResource, "status", c.ns, gitSourceAnalysis), &v1alpha1.GitSourceAnalysis{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.GitSourceAnalysis), err +} + +// Delete takes name of the gitSourceAnalysis and deletes it. Returns an error if one occurs. +func (c *FakeGitSourceAnalysises) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(gitsourceanalysisesResource, c.ns, name), &v1alpha1.GitSourceAnalysis{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGitSourceAnalysises) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(gitsourceanalysisesResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v1alpha1.GitSourceAnalysisList{}) + return err +} + +// Patch applies the patch and returns the patched gitSourceAnalysis. +func (c *FakeGitSourceAnalysises) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.GitSourceAnalysis, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(gitsourceanalysisesResource, c.ns, name, pt, data, subresources...), &v1alpha1.GitSourceAnalysis{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.GitSourceAnalysis), err +} diff --git a/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/generated_expansion.go b/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/generated_expansion.go new file mode 100644 index 0000000..245bdfd --- /dev/null +++ b/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/generated_expansion.go @@ -0,0 +1,25 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +type ComponentExpansion interface{} + +type GitSourceExpansion interface{} + +type GitSourceAnalysisExpansion interface{} diff --git a/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/gitsource.go b/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/gitsource.go new file mode 100644 index 0000000..3b7ab69 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/gitsource.go @@ -0,0 +1,191 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "time" + + v1alpha1 "github.com/redhat-developer/devconsole-api/pkg/apis/devconsole/v1alpha1" + scheme "github.com/redhat-developer/devconsole-api/pkg/client/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// GitSourcesGetter has a method to return a GitSourceInterface. +// A group's client should implement this interface. +type GitSourcesGetter interface { + GitSources(namespace string) GitSourceInterface +} + +// GitSourceInterface has methods to work with GitSource resources. +type GitSourceInterface interface { + Create(*v1alpha1.GitSource) (*v1alpha1.GitSource, error) + Update(*v1alpha1.GitSource) (*v1alpha1.GitSource, error) + UpdateStatus(*v1alpha1.GitSource) (*v1alpha1.GitSource, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1alpha1.GitSource, error) + List(opts v1.ListOptions) (*v1alpha1.GitSourceList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.GitSource, err error) + GitSourceExpansion +} + +// gitSources implements GitSourceInterface +type gitSources struct { + client rest.Interface + ns string +} + +// newGitSources returns a GitSources +func newGitSources(c *DevconsoleV1alpha1Client, namespace string) *gitSources { + return &gitSources{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the gitSource, and returns the corresponding gitSource object, and an error if there is any. +func (c *gitSources) Get(name string, options v1.GetOptions) (result *v1alpha1.GitSource, err error) { + result = &v1alpha1.GitSource{} + err = c.client.Get(). + Namespace(c.ns). + Resource("gitsources"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GitSources that match those selectors. +func (c *gitSources) List(opts v1.ListOptions) (result *v1alpha1.GitSourceList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.GitSourceList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("gitsources"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested gitSources. +func (c *gitSources) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("gitsources"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch() +} + +// Create takes the representation of a gitSource and creates it. Returns the server's representation of the gitSource, and an error, if there is any. +func (c *gitSources) Create(gitSource *v1alpha1.GitSource) (result *v1alpha1.GitSource, err error) { + result = &v1alpha1.GitSource{} + err = c.client.Post(). + Namespace(c.ns). + Resource("gitsources"). + Body(gitSource). + Do(). + Into(result) + return +} + +// Update takes the representation of a gitSource and updates it. Returns the server's representation of the gitSource, and an error, if there is any. +func (c *gitSources) Update(gitSource *v1alpha1.GitSource) (result *v1alpha1.GitSource, err error) { + result = &v1alpha1.GitSource{} + err = c.client.Put(). + Namespace(c.ns). + Resource("gitsources"). + Name(gitSource.Name). + Body(gitSource). + Do(). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + +func (c *gitSources) UpdateStatus(gitSource *v1alpha1.GitSource) (result *v1alpha1.GitSource, err error) { + result = &v1alpha1.GitSource{} + err = c.client.Put(). + Namespace(c.ns). + Resource("gitsources"). + Name(gitSource.Name). + SubResource("status"). + Body(gitSource). + Do(). + Into(result) + return +} + +// Delete takes name of the gitSource and deletes it. Returns an error if one occurs. +func (c *gitSources) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("gitsources"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *gitSources) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("gitsources"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched gitSource. +func (c *gitSources) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.GitSource, err error) { + result = &v1alpha1.GitSource{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("gitsources"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/gitsourceanalysis.go b/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/gitsourceanalysis.go new file mode 100644 index 0000000..76d7383 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/devconsole/v1alpha1/gitsourceanalysis.go @@ -0,0 +1,191 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "time" + + v1alpha1 "github.com/redhat-developer/devconsole-api/pkg/apis/devconsole/v1alpha1" + scheme "github.com/redhat-developer/devconsole-api/pkg/client/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// GitSourceAnalysisesGetter has a method to return a GitSourceAnalysisInterface. +// A group's client should implement this interface. +type GitSourceAnalysisesGetter interface { + GitSourceAnalysises(namespace string) GitSourceAnalysisInterface +} + +// GitSourceAnalysisInterface has methods to work with GitSourceAnalysis resources. +type GitSourceAnalysisInterface interface { + Create(*v1alpha1.GitSourceAnalysis) (*v1alpha1.GitSourceAnalysis, error) + Update(*v1alpha1.GitSourceAnalysis) (*v1alpha1.GitSourceAnalysis, error) + UpdateStatus(*v1alpha1.GitSourceAnalysis) (*v1alpha1.GitSourceAnalysis, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1alpha1.GitSourceAnalysis, error) + List(opts v1.ListOptions) (*v1alpha1.GitSourceAnalysisList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.GitSourceAnalysis, err error) + GitSourceAnalysisExpansion +} + +// gitSourceAnalysises implements GitSourceAnalysisInterface +type gitSourceAnalysises struct { + client rest.Interface + ns string +} + +// newGitSourceAnalysises returns a GitSourceAnalysises +func newGitSourceAnalysises(c *DevconsoleV1alpha1Client, namespace string) *gitSourceAnalysises { + return &gitSourceAnalysises{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the gitSourceAnalysis, and returns the corresponding gitSourceAnalysis object, and an error if there is any. +func (c *gitSourceAnalysises) Get(name string, options v1.GetOptions) (result *v1alpha1.GitSourceAnalysis, err error) { + result = &v1alpha1.GitSourceAnalysis{} + err = c.client.Get(). + Namespace(c.ns). + Resource("gitsourceanalysises"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GitSourceAnalysises that match those selectors. +func (c *gitSourceAnalysises) List(opts v1.ListOptions) (result *v1alpha1.GitSourceAnalysisList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.GitSourceAnalysisList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("gitsourceanalysises"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested gitSourceAnalysises. +func (c *gitSourceAnalysises) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("gitsourceanalysises"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch() +} + +// Create takes the representation of a gitSourceAnalysis and creates it. Returns the server's representation of the gitSourceAnalysis, and an error, if there is any. +func (c *gitSourceAnalysises) Create(gitSourceAnalysis *v1alpha1.GitSourceAnalysis) (result *v1alpha1.GitSourceAnalysis, err error) { + result = &v1alpha1.GitSourceAnalysis{} + err = c.client.Post(). + Namespace(c.ns). + Resource("gitsourceanalysises"). + Body(gitSourceAnalysis). + Do(). + Into(result) + return +} + +// Update takes the representation of a gitSourceAnalysis and updates it. Returns the server's representation of the gitSourceAnalysis, and an error, if there is any. +func (c *gitSourceAnalysises) Update(gitSourceAnalysis *v1alpha1.GitSourceAnalysis) (result *v1alpha1.GitSourceAnalysis, err error) { + result = &v1alpha1.GitSourceAnalysis{} + err = c.client.Put(). + Namespace(c.ns). + Resource("gitsourceanalysises"). + Name(gitSourceAnalysis.Name). + Body(gitSourceAnalysis). + Do(). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + +func (c *gitSourceAnalysises) UpdateStatus(gitSourceAnalysis *v1alpha1.GitSourceAnalysis) (result *v1alpha1.GitSourceAnalysis, err error) { + result = &v1alpha1.GitSourceAnalysis{} + err = c.client.Put(). + Namespace(c.ns). + Resource("gitsourceanalysises"). + Name(gitSourceAnalysis.Name). + SubResource("status"). + Body(gitSourceAnalysis). + Do(). + Into(result) + return +} + +// Delete takes name of the gitSourceAnalysis and deletes it. Returns an error if one occurs. +func (c *gitSourceAnalysises) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("gitsourceanalysises"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *gitSourceAnalysises) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("gitsourceanalysises"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched gitSourceAnalysis. +func (c *gitSourceAnalysises) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.GitSourceAnalysis, err error) { + result = &v1alpha1.GitSourceAnalysis{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("gitsourceanalysises"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +}